<ul>
    <li><a href="#fragment-1"><span>Summary</span></a></li>
    <li><a href="#fragment-2"><span>All product</span></a></li>
</ul>
<div id="fragment-1">
    <div class="section" id="productlist">
    	<div class="section-title">Products</div>
        
        <div class="section-content">
                <div class="sitemap treeindex">
                    <table class="data-table" cellpadding="0" cellspacing="0">
                    <thead>
                        <tr class="tr-head">
                            
                            <th>Product name</th>
                            <th>Begin total</th>
                            <th><?php echo $this->document->text['text_import']?></th>
                            
                            <th>Sale</th>
                            <th>End total</th>
                        </tr>
                    </thead>
                    
    <?php
        foreach($category as $val)
        {
    ?>
                    <thead>
                        <tr>
                            <td colspan="6" id="<?php echo $val['sitemapid']?>" onclick="showCategory(this.id)"><h1><b><a><?php echo html_entity_decode($val['sitemapname'])?></a></b></h1></td>
                        </tr>
                    </thead>
                    <tbody class="<?php echo $val['sitemapid']?> item">
            
            <?php
                $pro = $this->string->array_Filter($products,"refersitemap",$val['sitemapid']);
                foreach($pro as $item)
                {
                    if($item['export'] != 0 || $item['sale'] != 0)
                    {
            ?>
                        <tr>
                            
                            <td><?php echo $item['title']?> (<?php echo $item['unit']?>) </td>
                            <td align="right"><?php echo $this->string->numberFormate($item['inventorybegin'])?></td>
                            <td align="right"><?php echo $this->string->numberFormate($item['import'])?></td>
                            
                            <td align="right"><?php echo $this->string->numberFormate($item['sale'])?></td>
                            <td align="right" style="background-color:#CCC; font-weight:bold"><?php echo $this->string->numberFormate($item['inventorybegin'] + $item['import'] -           ($item['export'] + $item['sale']))?></td>
                        </tr>
            <?php
                    }
                }
            ?>    
                    </tbody>   
    <?php
        }
    ?>                               
                    
                    
                    </table>
                </div>
        </div>

    </div>
</div>
<div id="fragment-2">
    <div class="section" id="productlistall">
    	<div class="section-title">Products</div>
        
        <div class="section-content">
                <div class="sitemap treeindex">
                    <table class="data-table" cellpadding="0" cellspacing="0">
                    <thead>
                        <tr class="tr-head">
                            
                            <th>Product name</th>
                            <th>Begin total</th>
                            <th><?php echo $this->document->text['text_import']?></th>
                            
                            <th>Sale</th>
                            <th>End total</th>
                        </tr>
                    </thead>
                    
    <?php
        foreach($category as $val)
        {
    ?>
                    <thead>
                        <tr>
                            <td colspan="6" id="<?php echo $val['sitemapid']?>" onclick="showCategory(this.id)"><h1><b><a><?php echo html_entity_decode($val['sitemapname'])?></a></b></h1></td>
                        </tr>
                    </thead>
                    <tbody class="<?php echo $val['sitemapid']?> item">
            
            <?php
                $pro = $this->string->array_Filter($products,"refersitemap",$val['sitemapid']);
                foreach($pro as $item)
                {
                   
            ?>
                        <tr>
                            
                            <td><?php echo $item['title']?> (<?php echo $item['unit']?>) </td>
                            <td align="right"><?php echo $this->string->numberFormate($item['inventorybegin'])?></td>
                            <td align="right"><?php echo $this->string->numberFormate($item['import'])?></td>
                            
                            <td align="right"><?php echo $this->string->numberFormate($item['sale'])?></td>
                            <td align="right" style="background-color:#CCC; font-weight:bold"><?php echo $this->string->numberFormate($item['inventorybegin'] + $item['import'] -           ($item['export'] + $item['sale']))?></td>
                        </tr>
            <?php
                   
                }
            ?>    
                    </tbody>   
    <?php
        }
    ?>                               
                    
                    
                    </table>
                </div>
        </div>

    </div>
</div>

    
